//package com.zzyl.nursing.service.impl;
//
//import cn.hutool.core.date.LocalDateTimeUtil;
//import com.zzyl.nursing.domain.Reservation;
//import com.zzyl.nursing.mapper.NursingProjectMemberMapper;
//import com.zzyl.nursing.service.MemberReservationService;
//import com.zzyl.nursing.vo.CountByTimeMemberVo;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.time.LocalDateTime;
//
//@Service
//public class MemberReservationServiceImpl implements MemberReservationService {
//
//    @Autowired
//    private NursingProjectMemberMapper nursingProjectMemberMapper;
//    @Autowired
//
//    @Override
//    public Integer getCancelledReservationCount(Long userId) {
//        long time = System.currentTimeMillis();
//        LocalDateTime ldt = LocalDateTimeUtil.of(time);
//        LocalDateTime startTime = ldt.toLocalDate().atStartOfDay();
//        LocalDateTime endTime = startTime.plusDays(1);
//        Integer count =nursingProjectMemberMapper.getCancelledReservationCount(startTime,endTime,userId);
//        return count;
//    }
//
//    @Override
//    public CountByTimeMemberVo getCountByTime(Long time) {
//        LocalDateTime ldt = LocalDateTimeUtil.of(time);
//        LocalDateTime startTime= ldt.toLocalDate().atTime(8, 0);
//        LocalDateTime endTime = ldt.toLocalDate().atTime(18, 0);
//        CountByTimeMemberVo countByTime = nursingProjectMemberMapper.getCountByTime(startTime, endTime);
//        return countByTime;
//    }
//
//    @Override
//    public void addReservation(Reservation reservation) {
//        reservation.setStatus(0);
//        nursingProjectMemberMapper.insert(reservation);
//    }
//}
